package com.trg.flex.dt
{
	import mx.controls.dataGridClasses.DataGridColumn;
	import mx.core.IFactory;

	/**
	 * This subclass of DataGridColumn is used internally by DataTable to display a
	 * column of check boxes or radio buttons for displaying and manipulating selection.
	 */
	public class SelectionColumn extends DataGridColumn implements IFactory
	{
		public function SelectionColumn(columnName:String=null)
		{
			super(columnName);
			itemRenderer = this;
			width = 22;
			sortable = false;
			editable = false;
		}
		
		/**
		 * If true, check boxes are used and multiple rows may be selected at once.
		 * If false, radio buttons are used and only one row may be selected at a time.
		 */
		public var multiSelect:Boolean;
		
		public function newInstance():* {
			if (multiSelect)
				return new CheckBoxSelectionRenderer();
			else
				return new RadioButtonSelectionRenderer();
		}
	}
}